Limits problem 04.mws

1. Using Maple to find the equation of a tangent line. .

Recall that if ( x[0], y[0] ) is a point on a line with slope m , then an equation of the line is given by y = m(x-x[0])+y[0] , or if we want to express it as a function in the variable x , we could define the line by y = L(x) , where L(x) = m*(x-x[0])+y[0] . If we want to find the equation of the tangent line to a function f at the point ( x[0], f(x[0]) ), we first need to compute the slope, which is given as the limit of the difference quotient: m = limit((f(x[0]+h)-f(x[0]))/h,h = 0) . To illustrate this idea, suppose that we define

> f:=x->sin(x)+cos(x);

f := proc (x) options operator, arrow; sin(x)+cos(x...

> x0:=Pi;

x0 := Pi

Then the difference quotient is given by

> dq:=h->(f(x0+h)-f(x0))/h;

dq := proc (h) options operator, arrow; (f(x0+h)-f(...

> dq(h);

(-sin(h)-cos(h)+1)/h

Let us use maple to compute m = Limit((-sin(h)-cos(h)+1)/h,h = 0) .

> m:=limit((-sin(h)-cos(h)+1)/h,h=0);

m := -1

Let us define the function whose graph is the tangent line.

> L:=x-> m*(x-x0)+f(x0);

L := proc (x) options operator, arrow; m*(x-x0)+f(x...

> L(x);

-x+Pi-1

Finally, let us plot the function and its tangent line on the same graph.

> plot([L,f],0..2*Pi,color=[red,blue]);

[Maple Plot]

Notice that the line appears to be tangent to the curve at the point ( Pi, f(Pi) ).

Submission:

For the following functions:

(a) Plot y = f(x) over the interval [ x[0]-1/2, x[0]+3 ] .

(b) Define the function q(h) = (f(x[0]+h)-f(x[0]))/h with Maple.

(c) Find limit(q(h),h = 0) .

(d) Define the secant lines y = f(x[0])+q(h)(x-x[0]) for h = 3, 2 and 1. Graph them together with f and the tangent line over the interval in part (a).

  1. f[1](x) = x^3+2*x , x[0] = 0

  2. f[2](x) = x+5/x , x[0] = 1

  3. f[3](x) = x+sin(2*x) , x[0] = Pi/2

  4. f[4](x) = cos(x)+4*sin(2*x) , x[0] = Pi

Submission worksheet: